#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main()
{

	pid_t pid;
	pid = fork();
	if(pid < 0)
	{
		perror("fork");
	}else if(pid == 0)
	{
		
		printf("child\n");
		printf("child pid = %d, ppid = %d\n",getpid(),getppid());
		sleep(10);
		printf("程序\n");
	}else
	{
		//exit(0);
	}
	printf("child pid = %d, ppid = %d\n",getpid(),getppid());
}
